package com.jandan.web.front;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;
import org.springframework.web.servlet.view.RedirectView;
import org.springframework.web.util.WebUtils;


public class UserLoginController extends AbstractController {

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		UserSession userSession = (UserSession) WebUtils.getSessionAttribute(request, "userSession");
		if(userSession != null){
			ModelAndView model = new ModelAndView(new RedirectView("study.htm"));
			return model;
		}
		
		return new ModelAndView("login");
	}
}
